package com.xinhe.web.controller;

import com.xinhe.web.entity.AdapayMerchant;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@RestController
@RequestMapping(value = "/adapayMerchant")
@Api(value = "adapay商户", tags = "adapay商户")
public class AdapayMerchantController {

    /*@Autowired
    private IAdapayMerchantService adapayMerchantService;

    @ApiOperation(httpMethod = "GET", value = "分页查询adapay商户")
    @RequestMapping({"/pageAdapayMerchant"})
    public PageResult<AdapayMerchantView> pageAdapayMerchant(AdapayMerchantQuery query) {
        return this.adapayMerchantService.pageAdapayMerchant(query);
    }











    @ApiOperation(httpMethod = "POST", value = "保存adapay商户")
    @RequestMapping({"/saveAdapayMerchant"})
    public BaseResult saveAdapayMerchant(@Valid AdapayMerchantModel model, BindingResult bind) {
        if (bind.hasErrors()) {
            BaseResult result = new BaseResult();
            result.setBindingResult(bind);
            return result;
        }
        return (BaseResult)this.adapayMerchantService.saveModel((IdModel)model);
    }











    @ApiOperation(httpMethod = "GET", value = "删除adapay商户")
    @ApiImplicitParam(name = "adapayMerchantId", value = "标识", dataTypeClass = Long.class, required = true)
    @RequestMapping({"/deleteAdapayMerchant"})
    public BaseResult deleteAdapayMerchant(Long adapayMerchantId) {
        return this.adapayMerchantService.delete(adapayMerchantId);
    }











    @ApiOperation(httpMethod = "GET", value = "adapay商户详情")
    @ApiImplicitParam(name = "adapayMerchantId", value = "标识", dataTypeClass = Long.class, required = true)
    @RequestMapping({"/detailAdapayMerchant"})
    public BeanResult<AdapayMerchant> detailAdapayMerchant(Long adapayMerchantId) {
        return this.adapayMerchantService.findById(adapayMerchantId);
    }*/
}